<script setup lang="ts">
import { IS_ELECTRON } from '@/store/useEnv'
import { MessageOptions, useMessage } from 'naive-ui'
import { getCurrentInstance } from 'vue'

const ctx = getCurrentInstance()
const message = useMessage()
ctx!.appContext.config.globalProperties.$message = message

if (IS_ELECTRON) {
  const { ipcRenderer } = require('electron')
  ipcRenderer.on('message', (e, cont: string, opts: MessageOptions) => message.create(cont, opts))
}
</script>

<template>
  <div></div>
</template>
